<script>

var isdrag=false;
var x=0, y=0;
var dObj=null, dObjLeft=0, dObjTop=0;

function movemouse(e) {
	if (isdrag) {
		if(!e) e = event;
		dObj.style.left = dObjLeft + e.clientX - x;
		dObj.style.top = dObjTop + e.clientY - y;
		return false;
	}
}

function selectmouse(e) {
	if(!e) e = event;
	isdrag = true;
	dObj = e.target ? e.target : e.srcElement;
	dObjLeft = parseInt(dObj.style.left + 0);
	dObjTop = parseInt(dObj.style.top + 0);
	x = e.clientX;
	y = e.clientY;
	return false;
}

document.onmousedown = selectmouse;
document.onmousemove = movemouse;
document.onmouseup = new Function("isdrag=false;");

</script>

<img src="cal.gif" style='position:relative;' > 
